﻿<%@ Page Language="C#" MasterPageFile="~/Forms/Site.Master" AutoEventWireup="true"
    CodeBehind="CursosDocente.aspx.cs" Inherits="SchoolManagement.Forms.CursosDocente"
    Title="Docentes" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script src="../Javascripts/JScriptForms.js"></script>

    <center>
        <table width="90%" border="0" cellpadding="0" cellspacing="0" backcolor="#FFFFFF">
            <tr>
                <td valign="top" colspan="2">
                    <u><b>Docente:</b></u>
                    <br />
                    <br />
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2">
                    <hr />
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2">
                    <asp:DataList ID="DataListDocente" runat="server" DataSourceID="ObjectDataSourceDatosDocente">
                        <ItemTemplate>
                            Docente:
                            <asp:Label ID="DocenteLabel" runat="server" Text='<%# Eval("Docente") %>' />
                            <br />
                            TipoDocumento:
                            <asp:Label ID="TipoDocumentoLabel" runat="server" Text='<%# Eval("TipoDocumento") %>' />
                            <br />
                            Documento:
                            <asp:Label ID="DocumentoLabel" runat="server" Text='<%# Eval("Documento") %>' />
                            <br />
                            <br />
                        </ItemTemplate>
                    </asp:DataList>
                    <asp:ObjectDataSource ID="ObjectDataSourceDatosDocente" runat="server" SelectMethod="GetDatosBasicosDocente"
                        TypeName="BussinessLogic.Docente"></asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2">
                    <u><b>Asignaturas:</b></u>
                    <br />
                    <br />
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2">
                    <hr />
                </td>
            </tr>
            <tr style="width: 100%">
                <td colspan="2">
                    <asp:GridView ID="GridViewAsignaturas" runat="server" AutoGenerateColumns="False"
                        DataSourceID="LinqDataSourceAsignaturas" CellPadding="4" ForeColor="#333333"
                        GridLines="None">
                        <Columns>
                            <asp:TemplateField HeaderText=" ">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButtonStudent" runat="server" ImageUrl="~/Forms/images/student.gif"
                                        OnClick="ImageButtonStudent_Click" ToolTip="Consultar planilla estudiantes" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" SortExpression="Id"
                                Visible="False" />
                            <asp:BoundField DataField="IdDocente" HeaderText="IdDocente" ReadOnly="True" SortExpression="IdDocente"
                                Visible="False" />
                            <asp:BoundField DataField="Asignatura" HeaderText="Asignatura" ReadOnly="True" SortExpression="Asignatura" />
                            <asp:BoundField DataField="Area" HeaderText="Area" ReadOnly="True" SortExpression="Area" />
                            <asp:BoundField DataField="Grado" HeaderText="Grado" ReadOnly="True" SortExpression="Grado" />
                            <asp:TemplateField HeaderText="Actividades">
                                <ItemTemplate>
                                    <asp:Image ID="ImageCalendar" runat="server" ImageUrl="~/Forms/images/calendar.png" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="P1">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButtonP1" runat="server" CommandArgument="1" ImageUrl="~/Forms/images/editupdate.gif"
                                        OnClick="ImageButtonP1_Click" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="P2">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButtonP2" runat="server" CommandArgument="2" ImageUrl="~/Forms/images/editupdate.gif"
                                        OnClick="ImageButtonP1_Click" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="P3">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButtonP3" runat="server" CommandArgument="3" ImageUrl="~/Forms/images/editupdate.gif"
                                        OnClick="ImageButtonP1_Click" />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="P4">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButtonP4" runat="server" CommandArgument="4" ImageUrl="~/Forms/images/editupdate.gif"
                                        OnClick="ImageButtonP1_Click" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#507CD1" ForeColor="White" Font-Bold="True" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <asp:LinqDataSource ID="LinqDataSourceAsignaturas" runat="server" ContextTypeName="AccesoDatos.DataClassesSchoolDataContext"
                        Select="new (Id, IdDocente, Asignatura, Area, Grado)" TableName="DatosAsignaturasDocentes">
                    </asp:LinqDataSource>
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2">
                    &nbsp;
                </td>
            </tr>
            <tr style="width: 100%">
                <td valign="top" style="width: 40%">
                    <asp:GridView ID="GridViewPorcentajes" runat="server" AutoGenerateColumns="False"
                        CellPadding="4" DataSourceID="LinqDataSourcePeriodos" ForeColor="#333333" GridLines="None">
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:BoundField DataField="Nombre" HeaderText="Periodo" ReadOnly="True" SortExpression="Nombre" />
                            <asp:BoundField DataField="Porcentaje" HeaderText="%" ReadOnly="True" SortExpression="Porcentaje" />
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <asp:LinqDataSource ID="LinqDataSourcePeriodos" runat="server" ContextTypeName="AccesoDatos.DataClassesSchoolDataContext"
                        Select="new (Nombre, Porcentaje)" TableName="Periodos">
                    </asp:LinqDataSource>
                    &nbsp;<br />
                    <br />
                </td>
                <td style="width: 60%">
                    <asp:GridView ID="GridViewNotas" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSourceNotas"
                        CellPadding="4" ForeColor="#333333" GridLines="None">
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:BoundField DataField="IdAsignaturaDocente" HeaderText="IdAsignaturaDocente"
                                SortExpression="IdAsignaturaDocente" Visible="False" />
                            <asp:BoundField DataField="Codigo" HeaderText="Codigo" SortExpression="Codigo" />
                            <asp:BoundField DataField="Estudiante" HeaderText="Estudiante" SortExpression="Estudiante" />
                            <asp:BoundField DataField="Documento" HeaderText="Documento" SortExpression="Documento" />
                            <asp:BoundField DataField="Periodo" HeaderText="Periodo" SortExpression="Periodo" />
                            <asp:BoundField DataField="Nota" HeaderText="Nota" SortExpression="Nota" />
                            <asp:BoundField DataField="Fallas" HeaderText="Fallas" SortExpression="Fallas" />
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ObjectDataSourceNotas" runat="server" SelectMethod="ObtenerEstudiantesAsignaturaPeriodo"
                        TypeName="BussinessLogic.Estudiante">
                        <SelectParameters>
                            <asp:SessionParameter DefaultValue="-1" Name="idAsignaturaDocente" SessionField="IdAsignaturaDocente"
                                Type="Int32" />
                            <asp:SessionParameter DefaultValue="-1" Name="idPeriodo" SessionField="IdPeriodo"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>
            <tr>
                <td valign="top" colspan="2">
                    <hr />
                </td>
            </tr>
            <tr style="width: 100%">
                <td colspan="2">
                    <asp:GridView ID="GridViewEstudiantes" runat="server" AutoGenerateColumns="False"
                        DataSourceID="ObjectDataSourceEstudiantes" CellPadding="4" ForeColor="#333333"
                        GridLines="None">
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:BoundField DataField="IdAsignaturaDocente" HeaderText="IdAsignaturaDocente"
                                SortExpression="IdAsignaturaDocente" Visible="False" />
                            <asp:BoundField DataField="Codigo" HeaderText="Codigo" SortExpression="Codigo" />
                            <asp:BoundField DataField="Estudiante" HeaderText="Estudiante" SortExpression="Estudiante" />
                            <asp:BoundField DataField="Documento" HeaderText="Documento" SortExpression="Documento" />
                            <asp:BoundField DataField="Nota_1" HeaderText="Nota1" SortExpression="Nota_1" />
                            <asp:BoundField DataField="Falla_1" HeaderText="Falla1" SortExpression="Falla_1" />
                            <asp:BoundField DataField="Nota_2" HeaderText="Nota2" SortExpression="Nota_2" />
                            <asp:BoundField DataField="Falla_2" HeaderText="Falla2" SortExpression="Falla_2" />
                            <asp:BoundField DataField="Nota_3" HeaderText="Nota3" SortExpression="Nota_3" />
                            <asp:BoundField DataField="Falla_3" HeaderText="Falla3" SortExpression="Falla_3" />
                            <asp:BoundField DataField="Nota_4" HeaderText="Nota4" SortExpression="Nota_4" />
                            <asp:BoundField DataField="Falla_4" HeaderText="Falla4" SortExpression="Falla_4" />
                            <asp:BoundField DataField="Final" HeaderText="Final" SortExpression="Final" />
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <asp:ObjectDataSource ID="ObjectDataSourceEstudiantes" runat="server" SelectMethod="ObtenerEstudiantesAsignatura"
                        TypeName="BussinessLogic.Estudiante">
                        <SelectParameters>
                            <asp:SessionParameter DefaultValue="-1" Name="idAsignaturaDocente" SessionField="IdAsignaturaDocente"
                                Type="Int32" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                </td>
            </tr>
        </table>
    </center>
</asp:Content>
